// 统一地址管理
// 请求 登录/查询
import request from "./request";
import qs from 'qs'
// 请求精品数据
export const JingpinAPI = () => request.get("/products/recommend")
export const ReMenAPI = () => request.get("/products/hot")

//请求验证码
export const SendsMsAPI = params => request.post('/sendSMS', qs.stringify(params))
// 登录验证
export const PhoneLoginAPI = params => request.post("/phoneRegin", qs.stringify(params))
//微信扫码验证 
export const WeiXinLoginAPI = params => request.post("/wechatUsers/PCLogin", qs.stringify(params))
//手机绑定微信请求
export const BindPhoneAPI = (params) => request.post('/wechatUsers/binding', qs.stringify(params));
// 获取登录用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles");
// 请求详情页的数据
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`);
// 加入购物车
export const AddToCartAPI = (params) => request.post('/shop/carts/add', qs.stringify(params))
//商品搜索
export const GoodsSearchAPI = (params) => request.get('/products', { params: params })
// 请求购物车数据
export const CartDataAPI = () => request.get('/shop/carts');
// 删除购物车
export const CartDelAPI = (params) => request.delete(`/shop/carts?productIds=${params.id}`);